﻿define(function (require) {
    $(function () {
        var service = require('ezdesk/utility/service');
        require('model/Feed');
        require('model/FeedList');

        var DateView = require('view/DateView');
        var UpdateView = require('view/UpdateView');
        var NoticificationView = require('view/NotificationView');
        var FeedListView = require('view/FeedListView');
        var NotificationManager = require('ezdesk/service/notification-manager');


        NotificationManager.start();
        NotificationManager.newFeedsCallback = function (newFeeds) {
            console.log('refresh feed list...');
            service.GetFeeds(function (e) {
                feedsView.model.reset(e);
            }, { startIndex: 0, count: 30 })

        };


        var feedsView = new FeedListView({ model: new FeedList });

        service.GetFeeds(function (e) {
            feedsView.model.reset(e);
        }, { startIndex: 0, count: 30 })
    })
})
